//var baseUrl = environment() ? "https://web.chathot.me/" : "https://test.chathot.me/"

var baseUrl = environment() ? "https://webv2.whoisamy.shop/" : "http://test.web.chathot.me/"
var baseUrl1 = environment() ? "https://webv1.whoisamy.shop/" : "http://test.chathot.me/"
const API1 = {
// 鏄熺┖璇椾汉鍒濊禌
    api_request: baseUrl + "app/index.php?i=6&c=entry&m=db_play&do=api_request",
      request: baseUrl + "app/index.php?i=6&c=entry&m=db_play&do=request",

}
const API2 = {
  // 鏄熺┖璇椾汉鍒濊禌
      api_request: baseUrl1 + "app/index.php?i=6&c=entry&m=db_play&do=api_request",
        request: baseUrl1 + "app/index.php?i=6&c=entry&m=db_play&do=request",
  
  }
var api_request = function (data) {
    var sureData = {
        "Api_name": 'index_active_rank',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}

var api_activity = function (data) {
    var sureData = {
        "Api_name": 'activity',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}

var api_prize = function (data) {
    var sureData = {
        "Api_name": 'prize',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var api_invite = function (data) {
    var sureData = {
        "Api_name": 'invite',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var api_third_recharge = function (data) {
    var sureData = {
        "Api_name": 'third_recharge',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var activity_daily = function (data) {
    var sureData = {
        "Api_name": 'activity_daily',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var api_list = function (data) {
    var sureData = {
        "Api_name": 'list',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var index_query = function (data) {
    var sureData = {
        "Api_name": 'index_query',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var api_activity_task = function (data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_task',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}

var api_activity_list = function (data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_list',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}

var api_ludo = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'ludo',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}

var api_domino = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'domino',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}

//okey


var api_okey = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'okey',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}

//鎴橀紦

var api_drum = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'drum',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}



var api_egg_game = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'egg_game',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}


var activity_game = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'activity_game',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}



var activity_monster = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'activity_monster',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}

var activity_duty = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'activity_duty',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}

var activity_duty_img = function (data,file) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'activity_duty',
    "Api_data":JSON.stringify(data),
    "thumb":file
  }
  return ajax('GET',API1.api_request,  sureData)
}

var activity_family = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'activity_family',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}


var activity_star = function (data) {
  data.user_id=GetUrlParam('user_id');
   data.token=GetUrlParam('token');
  var sureData = {
    "Api_name":'activity_star',
    "Api_data":JSON.stringify(data)
  }
  return ajax('GET',API1.api_request,  sureData)
}
var activity_love = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_love',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var API_find = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'find',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}



var usernumber = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'usernumber',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}



var activity_crown = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_crown',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}





var api_shop = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'shop',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}




var activity_fruit = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_fruit',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}




var feedback_number = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'feedback_number',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}



var activity_country = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_country',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}


var activity_support = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_support',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}

var api_activity_country = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_country',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API1.api_request, sureData)
}

// 202111031503 zjy
var api_activity_data = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
      "Api_name": 'activity_data',
      "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API2.api_request, sureData)
}

